package org.testis.communication.client;


import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;

import javax.net.ServerSocketFactory;


public class TimeoutSockectFactory extends ServerSocketFactory
{

    public Socket createSocket(String hostname,
                               int port) throws IOException
    {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress(hostname,
                                             port),
                       6000);
        return socket;
    }


    public Socket createSocket(InetAddress hostAddress,
                               int port) throws IOException
    {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress(hostAddress,
                                             port),
                       6000);
        return socket;
    }


    public Socket createSocket(String remoteHost,
                               int remotePort,
                               InetAddress localAddress,
                               int localPort) throws IOException
    {
        return new Socket();
    }


    public Socket createSocket(InetAddress remoteAddress,
                               int remotePort,
                               InetAddress localAddress,
                               int localPort) throws IOException
    {
        return new Socket();
    }


    public ServerSocket createServerSocket(int port) throws IOException
    {
        return new ServerSocket();
    }


    public ServerSocket createServerSocket(int port,
                                           int backlog) throws IOException
    {
        return new ServerSocket();
    }


    public ServerSocket createServerSocket(int port,
                                           int backlog,
                                           InetAddress bindAddress) throws 
        IOException
    {
        return new ServerSocket();
    }
}
